package com.qf.config;

import org.aspectj.lang.annotation.*;
import org.springframework.stereotype.Component;
@Aspect
@Component
public class aopConfig {
    @Pointcut("execution(* com.qf.service.impl.*.*(..))")
    public void pc(){ }

    @Before("pc()")
    public void before(){
        System.out.println("前置");
    }


    @After("pc()")
    public void after(){
        System.out.println("后置");
    }


    @AfterThrowing("pc()")
    public void myThrows(){
        System.out.println("异常");
    }

//    @Around("pc()")
//    public Object huanRao(ProceedingJoinPoint point){
//        try {
//            System.out.println("前置");
//            Object proceed = point.proceed();
//            System.out.println("后置");
//            return proceed;
//        } catch (Throwable throwable) {
//            throwable.printStackTrace();
//            System.out.println("异常");
//            throw new RuntimeException("捕获异常");
//
//        } finally {
//            System.out.println("最终");
//        }
//
//    }
}
